/*

 @name    : 锅巴汉化 - Web汉化插件
 @author  : 麦子、JAR、小蓝、好阳光的小锅巴
 @version : V0.6.1 - 2019-07-09
 @website : http://www.g8hh.com

*/

//1.汉化杂项
var cnItems = {
    _OTHER_: [],

    //未分类：
    'Save': '保存',
    'Export': '导出',
    'Import': '导入',
    'Settings': '设置',
    'Achievements': '成就',
    'Statistics': '统计',
    'Changelog': '更新日志',
    'Hotkeys': '快捷键',
    'ALL': '全部',
    'Default': '默认',
    'AUTO': '自动',
    'default': '默认',
    "points": "点数",
    "Reset for +": "重置得到 + ",
    "Currently": "当前",
    "Effect": "效果",
    "Cost": "成本",
    "Goal:": "目标:",
    "Reward": "奖励",
    "Start": "开始",
    "Exit Early": "提前退出",
    "Finish": "完成",
    "Milestone Gotten!": "获得里程碑！",
    "Milestones": "里程碑",
    "Completed": "已完成",
    "Achievement Gotten!": "成就达成！",
    "Set Ticket Price": "设定车票价格",
    ", and": ", 和",
    "Yurakucho Line": "有乐町线",
    "About": "关于",
    "Add Track": "添加轨道",
    "Advertising": "广告",
    "Allows one more Locomotive per Station.": "每个车站允许多一列车。",
    "Are You Ready To Enter The Multiverse?": "你准备好进入多元宇宙了吗？",
    "Bank": "银行",
    "Bigger Cars": "更大的车",
    "Business Expertise (bXP": "商业专业知识 (bXP",
    "Buy All 1 Station": "所有线都购买 1 个车站",
    "Buy All Rolling Stock": "所有线购买车辆",
    "BUY MAX": "购买最大",
    "Carries passengers.": "载客。",
    "Change Theme Accent Color": "更改主题强调颜色",
    "Check out the": "查看",
    "Chiyoda Line": "千代田线",
    "Comes with 2 Stations, 1 Locomotive, and 1 Passenger Car.": "配备 2 个车站、1 辆机车和 1 辆客车。",
    "Created by": "作者",
    "Credit to": "鸣谢",
    "Debugging Tools": "调试工具",
    "Delete Save": "删除保存",
    "Doubles the max possible Ticket Price.": "将可能的最高票价翻倍。",
    "Fancier Trains": "更高级的火车",
    "for helpful information about game development.": "获取有关游戏开发的有用信息。",
    "Fukutoshin Line": "副都心线",
    "Gain 1000 bXP": "获得 1000 bXP",
    "Gain 1B money": "获得1B钱",
    "Generates passengers.": "产生乘客。",
    "Ginza Line": "银座线",
    "Hanzomon Line": "半藏门线",
    "here": "这里",
    "Hibiya Line": "日比谷线",
    "If you are ready,": "如果你准备好了，",
    "is": "是",
    "kastark": "卡斯塔克",
    "Level": "等级",
    "Line names and colors are inspired by the real-world": "干线名称和颜色灵感来自现实世界",
    "Lines": "干线",
    "Locomotive Horsepower": "机车马力",
    "Locomotives": "机车",
    "Locomotives can carry more cars.": "机车可以承载更多的汽车。",
    "Marunouchi Line": "丸之内线",
    "MFI Metro": "火车帝国",
    "MFI Metro is currently in beta development and progress may be reset between versions. This will be avoided as much as possible.": "MFI Metro 目前处于 beta 开发阶段，版本之间可能会重置进度。这将尽可能地避免。",
    "More Perks": "更多福利",
    "Namboku Line": "南北线",
    "only applies to current session": "仅适用于当前会话",
    "OPEN THE DOOR": "开门",
    "Options": "选项",
    "or": "或者",
    "Passenger Cars": "乘用车",
    "Passenger cars can carry more passengers.": "乘用车可以搭载更多的乘客。",
    "Passengers": "乘客",
    "Prestige": "声望",
    "Prestige Shop": "声望商店",
    "Pulls passenger cars.": "拉客车。",
    "Roadmap": "路线图",
    "SMMDesign": "SMM设计",
    "Stations": "车站",
    "Stations attract more customers.": "车站吸引了更多的顾客。",
    "Submit bug reports or feature requests": "提交错误报告或功能请求",
    "Subreddit": "子版块",
    "subway system.": "地铁系统。",
    "Ticket Price": "票价",
    "Tokyo Metro": "东京地铁",
    "Tozai Line": "东西线",
    "View the": "查看",
    "Your current unrealized": "您当前未实现",
    "Your trains appear twice as valueable to passengers.": "您的火车对乘客来说是价值的两倍。",
    "Your success as a train tycoon has opened doors you previously thought impossible. You have been approached by a mysterious corporation with the technology to travel back to the beginning of your empire while retaining your current level of business expertise. This will enable you to progress at even faster speeds, and unlocks new upgrades to further expand your train empire.": "您作为火车大亨的成功打开了您以前认为不可能的大门。 一家神秘的公司与您接洽，该公司拥有一项技术，可以让您回到您帝国的起点，同时保留您目前的商业专业知识水平。 这将使您能够以更快的速度前进，并解锁新的升级以进一步扩大您的火车帝国。",
    "Cost Reduction": "降低成本",
    "Current": "当前",
    "Current: ¥": "当前：¥",
    "custom": "自定义",
    "Doubles the percieved value of your service.": "使您的服务的感知价值翻倍。",
    "Each station can attract more customers.": "每个站点都可以吸引更多的客户。",
    "Formula: income * lines": "公式：收入*线",
    "Income is modified by the number of lines bought.": "收入由购买的行数修改。",
    "Income Multiplier": "收入乘数",
    "max": "最大",
    "min": "最小",
    "This upgrade doesn't do anything yet, don't buy it.": "这个升级还没有做任何事情，不要买它。",
    "upgrade lvl": "升级等级",
    "value": "价值",
    "Added Perks": "增加特权",
    "and start over!": "然后重新开始！",
    "as a learning experience after almost 10 years of being an avid incremental game player. It is currently in beta development and progress may be reset between versions. This will be avoided as much as possible.": "作为一个狂热的增量游戏玩家近 10 年的学习经历。 它目前处于 beta 开发阶段，可能会在版本之间重置进度。 这将尽可能地避免。",
    "Buy 1  Station Each": "各买 1 个站点",
    "Buy All Cars": "购买所有车",
    "Buy All Locomotives": "购买所有机车",
    "Donate": "捐赠",
    "donating": "捐赠",
    "Fancy Trains": "豪华列车",
    "Feel free to continue playing, or delete your save from": "随意继续玩，或删除您的存档",
    "Game Speed x10": "游戏速度 x10",
    "Gain 100 bXP": "获得 100 bXP",
    "The End!": "终点！",
    "Your success as a train tycoon has opened doors you previously thought impossible. You have been approached by a mysterious corporation with the technology to travel back to the beginning of your empire while retaining your current level of business expertise. This will enable you to grow at even faster speeds, and unlocks new upgrades to further expand your train empire.": "您作为火车大亨，成功打开了您以前认为不可能的大门。 一家神秘的公司与您接洽，该公司拥有一项技术，可以让您回到您帝国的起点，同时保留您目前的商业专业知识水平。 这将使您能够以更快的速度成长，并解锁新的升级以进一步扩大您的火车帝国。",
    "If you enjoyed playing, please consider": "如果你喜欢玩，请考虑",
    "If you have enjoyed my game and want to support my journey to become a self-sufficient designer and developer, please check out the links below.": "如果您喜欢我的游戏并希望支持我成为一名自给自足的设计师和开发人员的旅程，请查看以下链接。",
    "Locomotives can carry two more cars.": "机车可以再运载两辆汽车。",
    "MFI Metro is a game created by": "火车帝国 是一款由",
    "My Redbubble Shop": "我的红泡泡店",
    "or sharing the game on social media 💕": "或在社交媒体上分享游戏💕",
    "Passenger cars can carry 50 more passengers.": "乘用车可以多载50名乘客。",
    "Tickets": "车票",
    "Upgrade Engines": "升级引擎",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",

    //树游戏
    'Loading...': '加载中...',
    'ALWAYS': '一直',
    'HARD RESET': '硬重置',
    'Export to clipboard': '导出到剪切板',
    'INCOMPLETE': '不完整',
    'HIDDEN': '隐藏',
    'AUTOMATION': '自动',
    'NEVER': '从不',
    'ON': '打开',
    'OFF': '关闭',
    'SHOWN': '显示',
    'Play Again': '再次游戏',
    'Keep Going': '继续',
    'The Modding Tree Discord': '模型树Discord',
    'You have': '你有',
    'It took you {{formatTime(player.timePlayed)}} to beat the game.': '花费了 {{formatTime(player.timePlayed)}} 时间去通关游戏.',
    'Congratulations! You have reached the end and beaten this game, but for now...': '恭喜你！ 您已经结束并通关了本游戏，但就目前而言...',
    'Main Prestige Tree server': '主声望树服务器',
    'Reach {{formatWhole(ENDGAME)}} to beat the game!': '达到 {{formatWhole(ENDGAME)}} 去通关游戏!',
    "Loading... (If this takes too long it means there was a serious error!": "正在加载...（如果这花费的时间太长，则表示存在严重错误！",
    'Loading... (If this takes too long it means there was a serious error!)←': '正在加载...（如果时间太长，则表示存在严重错误！）←',
    'Main\n\t\t\t\tPrestige Tree server': '主\n\t\t\t\t声望树服务器',
    'The Modding Tree\n\t\t\t\t\t\t\tDiscord': '模型树\n\t\t\t\t\t\t\tDiscord',
    'Please check the Discord to see if there are new content updates!': '请检查 Discord 以查看是否有新的内容更新！',
    'aqua': '水色',
    'AUTOMATION, INCOMPLETE': '自动化，不完整',
    'LAST, AUTO, INCOMPLETE': '最后，自动，不完整',
    'NONE': '无',
    'P: Reset for': 'P: 重置获得',
    'Git游戏': 'Git游戏',
    'Patreon': 'Patreon',
    '': '',
    '': '',
    '': '',

}


//需处理的前缀
var cnPrefix = {
    "(-": "(-",
    "(+": "(+",
    "(": "(",
    "-": "-",
    "+": "+",
    " ": " ",
    ": ": "： ",
    "\n": "",
    "                   ": "",
    "                  ": "",
    "                 ": "",
    "                ": "",
    "               ": "",
    "              ": "",
    "             ": "",
    "            ": "",
    "           ": "",
    "          ": "",
    "         ": "",
    "        ": "",
    "       ": "",
    "      ": "",
    "     ": "",
    "    ": "",
    "   ": "",
    "  ": "",
    " ": "",
    //树游戏
    "\t\t\t": "\t\t\t",
    "\t\t": "\t\t",
    "\n\n\t\t": "\n\n\t\t",
    "\n\t\t": "\n\t\t",
    "Show Milestones: ": "显示里程碑：",
    "Autosave: ": "自动保存: ",
    "Offline Prod: ": "离线生产: ",
    "Completed Challenges: ": "完成的挑战: ",
    "High-Quality Tree: ": "高质量树贴图: ",
    "Offline Time: ": "离线时间: ",
    "Theme: ": "主题: ",
    "Anti-Epilepsy Mode: ": "抗癫痫模式：",
    "In-line Exponent: ": "直列指数：",
    "Single-Tab Mode: ": "单标签模式：",
    "Time Played: ": "已玩时长：",
    "Shift-Click to Toggle Tooltips: ": "Shift-单击以切换工具提示：",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
}

//需处理的后缀
var cnPostfix = {
    ":": "：",
    "：": "：",
    ": ": "： ",
    "： ": "： ",
    "/s)": "/s)",
    "/s": "/s",
    ")": ")",
    "%": "%",
    "                   ": "",
    "                  ": "",
    "                 ": "",
    "                ": "",
    "               ": "",
    "              ": "",
    "             ": "",
    "            ": "",
    "           ": "",
    "          ": "",
    "         ": "",
    "        ": "",
    "       ": "",
    "      ": "",
    "     ": "",
    "    ": "",
    "   ": "",
    "  ": "",
    " ": " ",
    "\n": "",
    "\n\t\t\t": "\n\t\t\t",
    "\t\t\n\t\t": "\t\t\n\t\t",
    "\t\t\t\t": "\t\t\t\t",
    "\n\t\t": "\n\t\t",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
}

//需排除的，正则匹配
var cnExcludeWhole = [
    /^(\d+)$/,
    /^\s*$/, //纯空格
    /^([\d\.]+)e(\d+)$/,
    /^([\d\.]+)$/,
    /^([\d\.]+)s$/,
    /^([\d\.]+)x$/,
    /^([\d\.]+) Billion$/,
    /^¥([\d\.]+) Billion$/,
    /^([\d\.]+) Million$/,
    /^¥([\d\.]+) Million$/,
    /^([\d\.]+) Trillion$/,
    /^¥([\d\.]+) Trillion$/,
    /^x([\d\.]+)$/,
    /^([\d\.,]+)$/,
    /^([\d\.,]+)x$/,
    /^x([\d\.,]+)$/,
    /^([\d\.]+)e([\d\.,]+)$/,
    /^x([\d\.]+)e([\d\.,]+)$/,
    /^([\d\.]+)e([\d\.,]+)x$/,
    /^[\u4E00-\u9FA5]+$/
];
var cnExcludePostfix = [
]

//正则替换，带数字的固定格式句子
//纯数字：(\d+)
//逗号：([\d\.,]+)
//小数点：([\d\.]+)
//原样输出的字段：(.+)
//换行加空格：\n(.+)
var cnRegReplace = new Map([
    [/^([\d\.]+) hours ([\d\.]+) minutes ([\d\.]+) seconds$/, '$1 小时 $2 分钟 $3 秒'],
    [/^You are gaining (.+) elves per second$/, '你每秒获得 $1 精灵'],
    [/^You have (.+) points$/, '你有 $1 点数'],
    [/^Next at (.+) points$/, '下一个在 $1 点数'],
	[/^([\d\.]+)\/sec$/, '$1\/秒'],
	[/^([\d\.,]+)\/sec$/, '$1\/秒'],
	[/^([\d\.,]+) OOMs\/sec$/, '$1 OOMs\/秒'],
	[/^([\d\.]+) OOMs\/sec$/, '$1 OOMs\/秒'],
	[/^([\d\.]+)e([\d\.,]+)\/sec$/, '$1e$2\/秒'],
    [/^requires ([\d\.]+) more research points$/, '需要$1个研究点'],
    [/^([\d\.]+)e([\d\.,]+) points$/, '$1e$2 点数'],
    [/^([\d\.]+) elves$/, '$1 精灵'],
    [/^([\d\.]+)e([\d\.,]+) elves$/, '$1e$2 精灵'],
    [/^([\d\.,]+) elves$/, '$1 精灵'],
    [/^\*(.+) to electricity gain$/, '\*$1 到电力增益'],
    [/^Cost: (.+) points$/, '成本：$1 点数'],
    [/^Req: (.+) \/ (.+) elves$/, '成本：$1 \/ $2 精灵'],
    [/^Usages: (\d+)\/$/, '用途：$1\/'],
    [/^workers: (\d+)\/$/, '工人：$1\/'],

]);